
#pragma once

#include "Controller_ModalDialog.h"
#include "../Preset/ExposedVariable.h"

class Element;
class CodeEditor;
class DragDropData;
class MenuBar;
class Panel;
class ScriptOutput;
class TabPages;
class Tickbox;
class TreeEditor;
class TextEditor;
class Panel;
class Widget;
class Button;

enum CONTROLLER_TYPES 
{
	CONTROLLER_NUMBER,
	CONTROLLER_SLIDER,
	CONTROLLER_COLOR
};

class Controller_Screen_Editor
{
	public:
		
		static void Show ();
		static void Hide ();
		
		static void Update();
		
		static Widget* GetControlByName( const char* szName );
		
	private:
		
		static void RecreateFromPreset();
		
		static bool TemplateList_BeginDragDrop( DragDropData* pxData, Widget* pxCaller );
		
		static bool Preset_DragOverCallback( const DragDropData* pxData, Widget* pxCaller );
		static void Preset_EndDragDropCallback( const DragDropData* pxData, Widget* pxCaller );
		static void Preset_OnSelection( FHandle xHandle );
		static void Preset_OnDelete( FHandle xHandle );

		static void Menu_Fridge_New( void* pUserData );
		static void Menu_Fridge_New_PostConfirmation( Controller_ModalDialogResult eResult );
		static void Menu_Fridge_Open( void* pUserData );
		static void Menu_Fridge_Save( void* pUserData );
		static void Menu_Fridge_SaveAs( void* pUserData );
		static void Menu_Fridge_MainMenu( void* pUserData );
		static void Menu_Fridge_Quit( void* pUserData );
		static void Menu_Fridge_Quit_PostConfirmation( Controller_ModalDialogResult eResult );
		static void Menu_Effect_SaveAsTemplate( void* pUserData );
		static void Menu_Preset_ResourceManager( void* pUserData );
		
		static void PopulateCodeTab( Panel* pxPanel );
		static void PopulateControlTab( Panel* pxPanel );
		static void PopulateAdvancedTab( Panel* pxPanel );
		static void PopulateMenuBar( MenuBar* pxMenuBar );
		
		static void Control_Panel_ButtonAddWidget( void* pUserData );	
		static void DialogCallback_AddWidget( const Controller_ModalDialogResult eType );
		static void AddExposeControl( ExposedVariable* pxExposedVariable );
		
		static u_int		s_uUserWidgetVerticalPos;
		
		static bool			s_bVisible;
		static bool			s_bNeedToUpdateControls;
		static bool			s_bShowingElementTabs;
		
		// Control Tab
		static Panel*		s_pxControlPanel;
		static Button*		s_pxAddWidgetButton;
		
		// Advanced Tab
		static bool			s_bElement_IsGroup;
		static bool			s_bElement_IsUILocked;
		static Tickbox*		s_pxUILockTickbox;
		static TextEditor*	s_pxElementNameBox;
		
		//static FHandle	s_xSelectedElement;
		
		static TreeEditor*	s_pxTreeEditor;
		static CodeEditor*	s_pxCodeEditor;
		static TextEditor*	s_pxScriptOutput;
		static TabPages*	s_pxElementTabs;
		static Panel*		s_pxControlTab;
		static Panel*		s_pxAdvancedTab;	
};

// eof
